# Maintainer: Ariadne Conill <ariadne@dereferenced.org>
pkgname=bonzomatic
_datever=2023-06-15
pkgver=${_datever//-/}
pkgrel=0
pkgdesc="OpenGL shader livecoding toy"
url="https://github.com/Gargaj/Bonzomatic"
arch="all"
license="Unlicense"
makedepends="
	alsa-lib-dev
	cmake
	fontconfig-dev
	glew-dev
	glfw-dev
	glu-dev
	libxcursor-dev
	libxi-dev
	libxinerama-dev
	libxrandr-dev
	mesa-dev
	samurai
	"
source="https://github.com/Gargaj/Bonzomatic/archive/$_datever/bonzomatic-$_datever.tar.gz"
builddir="$srcdir/Bonzomatic-$_datever"
options="!check" # no test suite

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		$CMAKE_CROSSOPTS
		# broken
		# -DBONZOMATIC_USE_SYSTEM_GLFW=ON \
		# -DBONZOMATIC_USE_SYSTEM_GLEW=ON \
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
60651dc16ce9c38e117a7530dbf17452dbcc50f2fa067b99a4c732c692e1b9b377da489135227c9d0492d9fe38e445a39d459f1f6567043054fdbc1646f85c1f  bonzomatic-2023-06-15.tar.gz
"
